package com.tricode.ile.training.task.sl275.lab5;

public class TestArrays {

    public static void main(String[] args) {

        int[] array1 = {2, 3, 5, 7, 11, 13, 17, 19};

        System.out.println("Printing array1: ");
        printArray(array1);

        int[] array2 = array1;

        for (int i = 0; i < array1.length; i++) {
            if (i % 2 == 0) {
                array2[i] = i;
            }
        }

        System.out.println("Printing array1: ");
        printArray(array2);
    }

    private static void printArray(int[] array) {
        System.out.print("<");
        for(int i = 0; i< array.length; i++){
            System.out.print(" "+array[i]);
        }
        System.out.println(" >");

    }
}

